<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org" lang="zh">
<head lang="zh">
    <meta charset="UTF-8">
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.5/css/bootstrap-theme.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap-fileinput/5.0.2/css/fileinput.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/bootstrap-fileinput/5.0.2/js/fileinput.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-fileinput/5.0.2/js/locales/zh.min.js"></script>
    <title></title>
</head>
<body>
<div class="box box-primary" style="margin-left: 30px;margin-right: 30px;margin-top: 20px">
    <div class="box-header with-border">
        <h3 class="box-title">创建存储桶</h3>
    </div>
    <div  id="bucketForm">
        <div class="box-body">
            <div class="form-group">
                <label for="bucketName">存储桶名称</label>
                <input type="text" class="form-control" id="bucketName" name="bucketName" placeholder="请输入存储桶名称">
            </div>
        </div>
        <div class="box-footer">
            <button id="create_btn" class="btn btn-primary">提交</button>
        </div>
    </div>
</div>
<!--<button id="upload">上传文件</button>-->
<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
</body>
<script type="text/javascript">
$("#create_btn").click(
    function () {
        $.ajax({
            type: 'POST',
            url: "/createBucket/",
            data: {
                "bucketName":$("#bucketName").val()
            },
        }).success(function (data) {
            $("#bucketName").val("");
            layer.alert(data["info"], {
                skin: 'layui-layer-molv',
                closeBtn: 0
            })
        }).error(function (data) {
            console.log(data)
            alert("创建失败");
        });
    }
)
</script>

</html>